function [name, param] = parseunit(o)
% Mordecai Lee, 2012-11-18, Sun, 01:41:34
% o.x:
%   - UnitName
%   - (UnitName)
%   - UnitName(UnitParam)
%   - (UnitName)(UnitParam)

[i, j] = regexp(o.x, '\s*\w+\s*\(');
if isempty(i)
    name = o.x;
    param = '';
    return
end

name = strtrim(o.x(i : j-1));
param = strtrim(o.x(j+1 : end-1));
